package com.zytech.zspider.core;

import com.zytech.modules.lang.Langs;

/**
 * @author siuming
 */
public class SpiderExceptions {
    /**
     * @param e
     * @return
     */
    public static SpiderException transform(Exception e) {
        Throwable t = Langs.toUnwrap(e);
        if (t instanceof SpiderException) {
            return (SpiderException) t;
        }

        return new SpiderException(e);
    }

    private SpiderExceptions() {
    }
}
